import {createRouter, createWebHistory} from 'vue-router'
import Home from '../views/home'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: "/connect",
    name: "connect",
    component: () => import('@/views/connect')
  },
  {
    path: '/content',
    name: 'content',
    component: Home,
    children: [
      {
        path: 'string/:key',
        name: 'stringContent',
        component: () => import('@/views/content/string_content')

      },
      {
        path: 'hash/:key',
        name: 'hashContent',
        component: () => import('@/views/content/hash_content')
      },
      {
        path: 'list/:key',
        name: 'listContent',
        component: () => import('@/views/content/list_content')
      },
      {
        path: 'set/:key',
        name: 'setContent',
        component: () => (import('../views/content/set_content'))
      }, {
        path: 'zset/:key',
        name: 'zsetContent',
        component: () => (import('../views/content/zset_content'))
      },
    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
